﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using DG.Tweening;
using UnityEngine.UI;

public class QuickWindow : MonoBehaviour {
    public Sprite s_left;
    public Sprite s_right;
    public Image img_shiJiao;

    Vector2 vec_pos1 = new Vector2(798,487);
    Vector2 vec_pos2 = new Vector2(1305,487);
	// Use this for initialization
	void Start () {
		
	}
	
	// Update is called once per frame
	void Update () {
		
	}

    public void OnClickSuojin()
    {
        Vector2 vec;
        Sprite spr;
        if(transform.localPosition.x == vec_pos1.x)
        {
            vec = vec_pos2;
            spr = s_right;
        }
        else
        {
            vec = vec_pos1;
            spr = s_left;
        }
        transform.DOLocalMoveX(vec.x, 0.8f);
        img_shiJiao.sprite = spr;
    }

}
